package com.chen.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chen.domain.AccountDetail;
import com.chen.dto.R;
import com.chen.service.AccountDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: chen
 * @Date: 2021/5/12 2:31 PM
 * @Version 1.0
 */
@RestController
@RequestMapping("/accountDetails")
public class AccountDetailsController {

    @Autowired
    private AccountDetailService accountDetailService;


    @GetMapping("/records")
    public R<Page<AccountDetail>> list(Page<AccountDetail> page,
                                       Long userId,
                                       String userName,
                                       String mobile,
                                       Long coinId,
                                       String amountStart,
                                       String amountEnd,
                                       Long accountId,
                                       String startTime,
                                       String endTime){

        Page<AccountDetail> pageForList = accountDetailService.findPageForList(page, userId,
                userName, mobile, coinId, amountStart, amountEnd, accountId, startTime, endTime);
        return R.ok(pageForList);
    }


}
